Move the "tail" question to the text view section. Add an entry for "why
authorMatthias Clasen <mclasen@redhat.com>
Fri, 29 Oct 2004 21:03:52 +0000 (21:03 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Fri, 29 Oct 2004 21:03:52 +0000 (21:03 +0000)
2004-10-29  Matthias Clasen  <mclasen@redhat.com>

* gtk/question_index.sgml: Move the "tail" question to the
text view section.
Add an entry for "why are my types not registered".  (#156809,
Q by Salvador Fandiño, A by Owen Taylor)

docs/reference/ChangeLog
docs/reference/gtk/question_index.sgml

index 3db3487155c55b35d65de02daa669704b00f2bb5..904265e013595703e4b09f0982263afab800e764 100644 (file)
@@ -1,3 +1,10 @@
+2004-10-29  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/question_index.sgml: Move the "tail" question to the
+       text view section.
+       Add an entry for "why are my types not registered".  (#156809,
+       Q by Salvador Fandiño, A by Owen Taylor)
+       
 2004-10-27  Matthias Clasen  <mclasen@redhat.com>
 
        * === Released 2.5.4 ===
index 29296c400271b52584074e65bd5166935a225a5a..931ec61a32deb92bf035a7f6c6b8e94313c661f6 100644 (file)
@@ -483,31 +483,25 @@ to the GNOME 2.0 platform</ulink>.
 <qandaentry>
 <question>
 <para>
-How do I make a text view scroll to the end of the buffer automatically ?
+Why are types not registered if I use their <literal>GTK_TYPE_BLAH;</literal> macro ?
 </para>
 </question>
 
 <answer>
 <para>
-The "insert" <link linkend="GtkTextMark">mark</link> marks the insertion point
-where <link linkend="gtk-text-buffer-insert">gtk_text_buffer_insert()</link>
-inserts new text into the buffer. The text is inserted 
-<emphasis>before</emphasis> the "insert" mark, so that it generally stays 
-at the end of the buffer. If it gets explicitly moved to some other position, 
-e.g. when the user selects some text, 
-use <link linkend="gtk-text-buffer-move-mark">gtk_text_buffer_move_mark()</link>
-to set it to the desired location before inserting more text. 
-The "insert" mark of a buffer can be obtained with <link
-linkend="gtk-text-buffer-get-insert">gtk_text_buffer_get_insert()</link>.
+The <literal>GTK_TYPE_BLAH</literal> macros are defined as calls to 
+<literal>gtk_blah_get_type()</literal>, and the <literal>_get_type()</literal> functions
+are declared as <literal>G_GNUC_CONST</literal> which allows the compiler to optimize
+the call away if it appears that the value is not being used.
 </para>
 
-<para> 
-To ensure that the end of the buffer remains visible, use
-<link
-               linkend="gtk-text-view-scroll-to-mark">gtk_text_view_scroll_to_mark()</link> to scroll to the "insert" mark after inserting new text.
+<para>
+A common workaround for this problem is to store the result in a volatile variable,
+which keeps the compiler from optimizing the call away.
+<informalexample><programlisting>
+volatile GType dummy = GTK_TYPE_BLAH;
+</programlisting></informalexample>
 </para>
-</answer>
-</qandaentry>
 </qandadiv>
 
 <qandadiv><title>Which widget should I use...</title>
@@ -732,6 +726,35 @@ To ensure that all text has the desired appearance, use <link
                linkend="gtk-widget-modify-font">gtk_widget_modify_font()</link> to change the default font for the widget.
 </para></answer>
 </qandaentry>
+
+<qandaentry>
+<question>
+<para>
+How do I make a text view scroll to the end of the buffer automatically ?
+</para>
+</question>
+
+<answer>
+<para>
+The "insert" <link linkend="GtkTextMark">mark</link> marks the insertion point
+where <link linkend="gtk-text-buffer-insert">gtk_text_buffer_insert()</link>
+inserts new text into the buffer. The text is inserted 
+<emphasis>before</emphasis> the "insert" mark, so that it generally stays 
+at the end of the buffer. If it gets explicitly moved to some other position, 
+e.g. when the user selects some text, 
+use <link linkend="gtk-text-buffer-move-mark">gtk_text_buffer_move_mark()</link>
+to set it to the desired location before inserting more text. 
+The "insert" mark of a buffer can be obtained with <link
+linkend="gtk-text-buffer-get-insert">gtk_text_buffer_get_insert()</link>.
+</para>
+
+<para> 
+To ensure that the end of the buffer remains visible, use
+<link
+               linkend="gtk-text-view-scroll-to-mark">gtk_text_view_scroll_to_mark()</link> to scroll to the "insert" mark after inserting new text.
+</para>
+</answer>
+</qandaentry>
 </qandadiv>